package org.xserver.component.core.dispatch;

import org.xserver.component.core.XServerHttpContextAttachment;
import org.xserver.component.handler.ext.WriteHandler;

/**
 * Every request from client, the request dispatch in here.
 * 
 * @author idoldefine
 * @since 2016/07/15
 *
 */
public interface RequestDispatch {
	/**
	 * Process client request and response to client
	 * 
	 * @param attachment
	 *            the channel context
	 * @param writeHandler 
	 * @return
	 * @throws Exception
	 */
	public abstract void requestDispatch(
			XServerHttpContextAttachment attachment, WriteHandler writeHandler) throws Exception;

	/**
	 * Get the unified name for request dispatch
	 */
	public abstract String getName();
}
